package dup.login.demo.mapper;

import dup.login.demo.domain.User;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface UserMapper {
    @Select("select * from users")
    @Results({
            @Result(property = "id", column = "id"),
            @Result(property = "name", column = "name"),
            @Result(property = "email", column = "email")
    })
    ArrayList<User> getUserList();

    @Select("select * from users where name = #{username}")
    User getByUsername(String username);
}
